﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Management;
using System.Text;
using WMI.NET.Abstracts;
using WMI.NET.CIM;

namespace WMI.NET.ComputerSystemHardware.MassStorage
{
    /// <summary>
    /// The Win32_PhysicalMedia class represents any type of documentation or storage medium, such as tapes, CD ROMs, and so on. To obtain the characteristics of the media in a CD drive, such as whether it is writeable, use Win32_CDROMDrive and the Capabilities property.
    /// </summary>
    public class Win32_PhysicalMedia : CIM_PhysicalMedia
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public Win32_PhysicalMedia(ManagementBaseObject mbo)
            : base(mbo)
        {

        }
    }


    /// <summary>
    /// 
    /// </summary>
    public class GetWin32_PhysicalMedia : Win32Collection<Win32_PhysicalMedia>
    {

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override ReadOnlyCollection<Win32_PhysicalMedia> GetCollection()
        {
            List<Win32_PhysicalMedia> tempCollection = new List<Win32_PhysicalMedia>();

            foreach (var s in searcher.Get())
            {
                Win32_PhysicalMedia tempListItem = new Win32_PhysicalMedia(s);
                tempCollection.Add(tempListItem);
            }

            return tempCollection.AsReadOnly();
        }

        /// <summary>
        /// 
        /// </summary>
        public GetWin32_PhysicalMedia() : base("SELECT * FROM Win32_PhysicalMedia") { }

    }

}
